package cn.cvs.dao;

import cn.cvs.pojo.Supplier;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SupplierMapper {
    /**
     * 增加供货商
     * @param supplier
     * @return
     */
    public boolean add(Supplier supplier) throws Exception;

    /**
     * 获取供应商列表
     * @return
     * @throws Exception
     */
    public List<Supplier> getList() throws Exception;

    /**
     * 通过供应商名称、编码获取供应商列表-模糊查询
     * @param supName
     * @param supCode
     * @param currentPageNo
     * @param pageSize
     * @return
     */
    public List<Supplier> getListIndex(@Param("supName") String supName, @Param("supCode") String supCode,@Param("currentPageNo") int currentPageNo,@Param("pageSize") int pageSize) throws Exception;

    /**
     * 通过条件查询-供应商表记录数
     * @param supName
     * @param supCode
     * @return
     * @throws Exception
     */
    public int getCount(@Param("supName") String supName,@Param("supCode") String supCode) throws Exception;

    /**
     * 根据id查询
     * @param id
     * @return
     */
    public Supplier getById(@Param("id") Integer id) throws Exception;


    /**
     * 修改供货商
     * @param supplier
     * @return
     */
    public boolean update(Supplier supplier) throws Exception;

    /**
     * 根据id删除供货商信息
     * @param id
     * @return
     * @throws Exception
     */
    public boolean deleteById(@Param("id") Integer id) throws Exception;
}
